Skip to content

Conversation

tmathern
Copy link
Collaborator

@tmathern tmathern commented Jun 25, 2025

  • Add some very basic filetype guessing capabilities to handle files that are extensionless but the recommendation for usage would be to use files with extensions. So there is no doubt about the filetype.

tmathern and others added 8 commits June 25, 2025 09:01
* fix: No error emssage dict recreation, all strings are static, so...

* fix: Imports

* fix: autopep8 formatting opinions

* fix: Errors become consistent

* fix: Stream closing error handling

* fix: Stream error handling update

* fix: Format

* fix: Format 2
@tmathern tmathern self-assigned this Jun 25, 2025
@tmathern tmathern requested a review from gpeacock June 25, 2025 21:55
@tmathern tmathern changed the base branch from main to mathern/sign-file June 25, 2025 21:56
Base automatically changed from mathern/sign-file to main June 26, 2025 23:10
Copy link
Contributor

@gpeacock gpeacock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great example of why I want most of the functionality tests in Rust instead of repeating them in every language. The appropriate level of testing in python should just be to validate that a file without an extension can be processed. The rest of the tests should be handled in Rust so that we don't need to duplicate them, and all the test files everywhere. Large test files slow down builds.
I'd prefer most of these test files to only live in one place. We may want to create a separate repo for them if they really need to be shared like this.

@tmathern
Copy link
Collaborator Author

tmathern commented Jun 27, 2025

This is a great example of why I want most of the functionality tests in Rust instead of repeating them in every language. The appropriate level of testing in python should just be to validate that a file without an extension can be processed. The rest of the tests should be handled in Rust so that we don't need to duplicate them, and all the test files everywhere. Large test files slow down builds. I'd prefer most of these test files to only live in one place. We may want to create a separate repo for them if they really need to be shared like this.

So hmmm, how do we proceed? Do you want me to remove the test files (and related tests for the mimetype guessing, then - aka the whole TestHelpers class currently)? As I added 3 tests that cover extensionless files.
Noting that this becomes obsolete once that code has been pulled down there.

@tmathern tmathern requested a review from gpeacock June 27, 2025 17:28
@tmathern
Copy link
Collaborator Author

Let's put a pin in that for now - if the guessing moves down soon to the c2pa-rs Rust code SDK, we can heavily simplify that (by just adding the tests to verify the functionality).

@tmathern tmathern changed the title feat: Add some filetype guessing capabilities [ON-HOLD] feat: Add some filetype guessing capabilities Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants